// pages/userStatistics/WriteOff/WriteOff.js
const controller=require("../../controllers/Controller").controller

Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[],
    userId:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if(options.accountId){
      this.setData({
        userId:options.accountId
      })
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  // onShareAppMessage: function () {

  // }

  //跳转
  jumpToOrderList(e){
    let type=e.currentTarget.dataset.type
    if(type==1){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/couponList/couponList?userId='+this.data.userId,
      })
    }else if(type==2){
      wx.navigateTo({
        url: '/pages/settlement/CardInfo/VIPCardList?userId='+this.data.userId,
      })
    }else if(type==3){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/integralDetail/integralDetail?userId='+this.data.userId,
      })
    }else if(type==4){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/activityList/activityList?userId='+this.data.userId+'&bagType=2',
      })
    }else if(type==5){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/activityList/activityList?userId='+this.data.userId+'&bagType=3',
      })
    }else if(type==6){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/activityList/activityList?userId='+this.data.userId+'&bagType=4',
      })
    }else if(type==7){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/activityList/activityList?userId='+this.data.userId+'&bagType=5',
      })
    }else if(type==8){
      wx.navigateTo({
        url: '/pages/userStatistics/WriteOff/couponList/couponList?cardPass=1&userId='+this.data.userId,
      })
    }
  }
})